<!DOCTYPE html>

<html xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">


<h:head>

	<style type="text/css">
.content {
	position: relative;
	width: 100%;
	margin: 0 auto;
}

.ui-layout,.ui-layout-doc,.ui-layout-unit,.ui-layout-wrap,.ui-layout-bd,.ui-layout-hd
	{
	border: none;
}

.companyHeaderGrid tr,.companyHeaderGrid td {
	border: none;
}

.delete-btn,.ui-widget-content .delete-btn {
	-moz-box-shadow: inset 0px 1px 0px 0px #f5978e;
	-webkit-box-shadow: inset 0px 1px 0px 0px #f5978e;
	box-shadow: inset 0px 1px 0px 0px #f5978e;
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f24537
		), color-stop(1, #c62d1f));
	background: -moz-linear-gradient(top, #f24537 5%, #c62d1f 100%);
	background: -webkit-linear-gradient(top, #f24537 5%, #c62d1f 100%);
	background: -o-linear-gradient(top, #f24537 5%, #c62d1f 100%);
	background: -ms-linear-gradient(top, #f24537 5%, #c62d1f 100%);
	background: linear-gradient(to bottom, #f24537 5%, #c62d1f 100%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f24537',
		endColorstr='#c62d1f', GradientType=0);
	background-color: #f24537;
	-moz-border-radius: 6px;
	-webkit-border-radius: 6px;
	border-radius: 6px;
	border: 1px solid #d02718;
	display: inline-block;
	cursor: pointer;
	color: #ffffff;
	font-family: arial;
	font-size: 15px;
	font-weight: bold;
	text-decoration: none;
	text-shadow: 0px 1px 0px #810e05;
}

.delete-btn:hover {
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #c62d1f
		), color-stop(1, #f24537));
	background: -moz-linear-gradient(top, #c62d1f 5%, #f24537 100%);
	background: -webkit-linear-gradient(top, #c62d1f 5%, #f24537 100%);
	background: -o-linear-gradient(top, #c62d1f 5%, #f24537 100%);
	background: -ms-linear-gradient(top, #c62d1f 5%, #f24537 100%);
	background: linear-gradient(to bottom, #c62d1f 5%, #f24537 100%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c62d1f',
		endColorstr='#f24537', GradientType=0);
	background-color: #c62d1f;
}

.delete-btn:active {
	position: relative;
	top: 1px;
}
</style>

</h:head>

<h:body>
	<img class="content" src="#{resource['images/top.jpg']}" alt="immagine top"></img>

	<!-- Importo il css per la customizzazione della pagina -->
	<h:outputStylesheet name="/css/custom.css" />


	<p:growl id="growl" for="growl-message" showDetail="true" sticky="true" />

	<p:layout fullPage="false" style=" min-width: 90%; height: 1000px">

		<p:layoutUnit position="north"
			style="min-height:100px; font-size: 13pt">
			<p:toolbar>
				<p:toolbarGroup align="right">
					<h:form>
						<p:commandButton id="logoutButton" value="Logout"
							icon="ui-icon-play" action="#{logoutBean.logout()}" />
					</h:form>
				</p:toolbarGroup>
			</p:toolbar>
		</p:layoutUnit>


		<!-- START - ZONA SX DELLA PAGINA -->
		<p:layoutUnit position="west" collapsible="true" size="22%" gutter="0">

			<!-- Inserisco dal file left_menu (della cartella corrente) il menu con i comandi -->
			<ui:insert name="left-menu">
				<div style="padding: 0px 0px 0px 0px">
					<ui:include src="left_menu.xhtml" />
				</div>
			</ui:insert>

		</p:layoutUnit>
		<!-- STOP - ZONA SX DELLA PAGINA -->

		<!-- START - Dettagli del pacchetto -->
		<p:layoutUnit position="center"
			style="padding-left: 10px;margin-bottom: 0px" size="100%">
			<h:form id="edit_trasporto_form">

				<p:panelGrid columns="3" id="trasporto-data-panel"
					style="min-width: 100%; margin: 0 auto"
					styleClass="companyHeaderGrid">


					<p:growl id="trasportoGrowl" autoUpdate="true"
						for="edit_trasporto_growl" showDetail="true"/>


					<f:facet name="header">
						<p:outputLabel style="font-size: 15pt">Dati del trasporto da modificare</p:outputLabel>
					</f:facet>

					<h:outputText value="Citta di Partenza: " />
					<p:autoComplete id="city_p"
						value="#{trasportoBean.trasportoSelezionato.cittaPartenza}"
						label="Citta Partenza" completeMethod="#{cittaBean.complete}"
						var="c" required="true" itemLabel="#{c.name}" minQueryLength="3"
						itemValue="#{c}" forceSelection="true" converter="cittaConverter"
						requiredMessage="Inserire la citta">
						<p:ajax event="itemSelect" update="city_p" />
					</p:autoComplete>
					<p:message display="text" for="city_p" />


					<h:outputText value="Citta di Arrivo: " />
					<p:autoComplete id="city_a"
						value="#{trasportoBean.trasportoSelezionato.cittaArrivo}"
						label="Citta Partenza" completeMethod="#{cittaBean.complete}"
						var="c" required="true" itemLabel="#{c.name}" minQueryLength="3"
						itemValue="#{c}" forceSelection="true" converter="cittaConverter"
						requiredMessage="Inserire la citta">
						<p:ajax event="itemSelect" update="city_a" />
					</p:autoComplete>
					<p:message display="text" for="city_p" />

					<h:outputText value="Data Trasporto: " />
					<p:calendar value="#{trasportoBean.trasportoSelezionato.data}"
						id="cal_partenza" showButtonPanel="true" required="true"
						requiredMessage="Inserire la data del trasporto"
						mindate="#{pacchettoBean.CURRENT_DATE}" readonlyInput="true">

					</p:calendar>
					<p:message display="text" for="cal_partenza" />

					<h:outputText value="Prezzo: " />
					<p:inputText id="prezzo_trasporto" required="true"
						requiredMessage="Inserire un prezzo per il trasporto"
						value="#{trasportoBean.trasportoSelezionato.prezzo}" />
					<p:message display="text" for="prezzo_trasporto" />

					<h:outputText value="Posti disponibili: " />
					<p:inputText id="disponibilita" required="true"
						requiredMessage="Inserire il numero di posti disponibili"
						value="#{trasportoBean.trasportoSelezionato.disponibilita}" />
					<p:message display="text" for="disponibilita" />

					<f:facet name="footer">
						<p:commandButton value="Conferma"
							action="#{trasportoBean.editTrasporto}"
							update="trasporto-data-panel" />

					</f:facet>
				</p:panelGrid>
			</h:form>


		</p:layoutUnit>
		<!-- STOP - Dettagli del pacchetto -->

	</p:layout>
	<img class="content" src="#{resource['images/bottom.jpg']}" alt="immagine top"></img>

</h:body>
</html>